package scottb.flex;

import java.awt.*;

public class VGroup extends FlexPanel {    
                          
    private Integer paddingTop;
    private Integer paddingRight;
    private Integer paddingBottom;
    private Integer paddingLeft;
    private Integer gap;
    private HAlign align = HAlign.LEFT;

    public VGroup(Component...components) {

        setLayout(new VGroupLayoutManager());
        setOpaque(false);

        for(Component c : components) {
            add(c);
        }
    }

    public VGroup padding(Integer padding) {

        paddingTop = padding;
        paddingRight = padding;
        paddingBottom = padding;
        paddingLeft = padding;

        return this;
    }

    public VGroup padding(Integer vPadding, Integer hPadding) {

        paddingTop = vPadding;
        paddingRight = hPadding;
        paddingBottom = vPadding;
        paddingLeft = hPadding;

        return this;
    }

    public VGroup padding(Integer top, Integer right, Integer bottom, Integer left) {

        paddingTop = top;
        paddingRight = right;
        paddingBottom = bottom;
        paddingLeft = left;

        return this;
    }

    public VGroup paddingTop(Integer padding) {

        paddingTop = padding;

        return this;
    }

    public VGroup paddingRight(Integer padding) {

        paddingRight = padding;

        return this;
    }

    public VGroup paddingBottom(Integer padding) {

        paddingBottom = padding;

        return this;
    }

    public VGroup paddingLeft(Integer padding) {

        paddingLeft = padding;

        return this;
    }

    public Integer paddingTop() {
        return paddingTop;
    }

    public Integer paddingRight() {
        return paddingRight;
    }

    public Integer paddingBottom() {
        return paddingBottom;
    }

    public Integer paddingLeft() {
        return paddingLeft;
    }
               
    public VGroup gap(Integer gap) {

        this.gap = gap;

        return this;
    }

    public Integer gap() {

        return gap;
    }

    public VGroup align(HAlign align) {

        this.align = align;

        return this;
    }

    public VGroup align(String align) {

        this.align = HAlign.lookup(align);

        return this;
    }

    public HAlign align() {

        return align;
    }

    
    public VGroup top(Integer top) {
        super.top(top);
        return this;
    }

    public VGroup left(Integer left) {
        super.left(left);
        return this;
    }

    public VGroup right(Integer right) {
        super.right(right);
        return this;
    }

    public VGroup bottom(Integer bottom) {
        super.bottom(bottom);
        return this;
    }

    public VGroup horizontalCenter(Integer center) {
        super.horizontalCenter(center);
        return this;
    }

    public VGroup verticalCenter(Integer center) {
        super.verticalCenter(center);
        return this;
    }

    public VGroup center() {
        super.center();
        return this;
    }

    public VGroup width(Integer width) {
        super.width(width);
        return this;
    }

    public VGroup height(Integer height) {
        super.height(height);
        return this;
    }

    // BACKGROUND

    public VGroup background(Color color) {

        super.background(color);

        return this;
    }

    public VGroup background(Integer color) {

        super.background(color);

        return this;
    }

    public VGroup backgroundAlpha(Float alpha) {

        super.backgroundAlpha(alpha);

        return this;
    }

    public VGroup backgroundAlpha(Double alpha) {

        super.backgroundAlpha(alpha);

        return this;
    }

    public VGroup gradient2(Integer color1, Integer color2) {

        super.gradient2(color1, color2);

        return this;
    }

    public VGroup gradient2(Color color1, Integer color2) {

        super.gradient2(color1, color2);

        return this;
    }

    public VGroup gradient2(Integer color1, Color color2) {

        super.gradient2(color1, color2);

        return this;
    }

    public VGroup gradient2(Color color1, Color color2) {

        super.gradient2(color1, color2);

        return this;
    }

    // BORDER

    public VGroup borderColor(Integer color) {

        super.borderColor(color);

        return this;
    }

    public VGroup borderColor(Color color) {

        super.borderColor(color);

        return this;
    }

    public VGroup borderWeight(Integer weight) {

        super.borderWeight(weight);

        return this;
    }

    public VGroup border(Integer color) {

        super.border(color);

        return this;
    }

    public VGroup border(Color color) {

        super.border(color);

        return this;
    }

    public VGroup border(Integer color, Integer weight) {

        super.border(color, weight);

        return this;
    }

    public VGroup border(Color color, Integer weight) {

        super.border(color, weight);

        return this;
    }

    public VGroup border(Integer color, Integer weight, Integer radius) {

        super.border(color, weight, radius);

        return this;
    }


    public VGroup cornerRadius(Integer radius) {

        super.cornerRadius(radius);

        return this;
    }

    public VGroup cornerRadius(Integer topLeft, Integer topRight, Integer bottomLeft, Integer bottomRight) {

        super.cornerRadius(topLeft, topRight, bottomLeft, bottomRight);

        return this;
    }
    
    // ADD CHILDREN
    public VGroup add(Component c) {
        super.add(c);
        return this;
    }
}
